Start Log
The Start Log command turns on logging in the Script Editor's Event Log window, which is shown in Figure 2-7.If the checkboxes Show Events and Show Event Results are both selected, as shown in Figure 2-7, subsequent commands sent by the Script Editor and the results returned for each event are displayed in this window. You can choose to display either the events or their results by selecting just one of the checkboxes. You can also save a copy of the text in the Event Log window by choosing Save As from the File menu.
Unlike most other scripting additions, the Start Log command is built into
the AppleScript extension. It doesn't have a separate file in the Scripting Additions folder.Figure 2-7 The Script Editor's Event Log window
SYNTAX
start logRESULT
NoneEXAMPLE
The example that follows demonstrates how to start logging and demonstrates how logging works. To see descriptions in AppleScript of the logged events generated by this example, open the Event Log window in the Script Editor application by choosing Open Event Log from the Controls menu. Make sure that both the Show Events and Show Event Results checkboxes are selected, as shown in Figure 2-7.
start log display dialog "Hello"After you run the preceding script, the record of the events sent and the result returned appear in the Event Log window. Because the Display Dialog command in this script is not enclosed in a Tell statement, Script Editor sends the command to the current application--that is, to itself. The event log for
the script shows both this implicit Tell statement and the result returned
by the Display Dialog command.ERRORS